home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / file / managers / mc-3.2 / mc-3 / mc-3.2.1 / src / subshell.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-17  |  1.3 KB  |  44 lines

  1. #ifndef __SUBSHELL_H
  2. #define __SUBSHELL_H
  3.  
  4. /* If using a subshell for evaluating commands this is true */
  5. extern int use_subshell;
  6.  
  7. /* Used to distinguish between a normal MC termination and */
  8. /* one caused by typing `exit' or `logout' in the subshell */
  9. #define SUBSHELL_EXIT 127
  10.  
  11. #ifdef HAVE_SUBSHELL_SUPPORT
  12.  
  13. /* File descriptor of the pseudoterminal used by the subshell */
  14. extern int subshell_pty;
  15.  
  16. /* If true, the child forked in init_subshell will wait in a loop to be attached by gdb */
  17. extern int debug_subshell;
  18.  
  19. /* The key to switch back to MC from the subshell */
  20. extern char subshell_switch_key;
  21.  
  22. /* State of the subshell; see subshell.c for an explanation */
  23. enum subshell_state_enum {INACTIVE, ACTIVE, RUNNING_COMMAND};
  24. extern enum subshell_state_enum subshell_state;
  25.  
  26. /* Holds the latest prompt captured from the subshell */
  27. extern char *subshell_prompt;
  28.  
  29. /* For the `how' argument to various functions */
  30. enum {QUIETLY, VISIBLY};
  31.  
  32. /* Exported functions */
  33. void init_subshell (void);
  34. int invoke_subshell (const char *command, int how, char **new_dir);
  35. int read_subshell_prompt (int how);
  36. void resize_subshell (void);
  37. int exit_subshell (void);
  38. void do_subshell_chdir (char *command, int update_prompt, int reset_prompt);
  39. void subshell_get_console_attributes (void);
  40. void sigchld_handler (int sig);
  41.  
  42. #endif /* HAVE_SUBSHELL_SUPPORT */
  43. #endif /* __SUBSHELL_H */
  44.